fix(canvas): always run canvas generation as a cloud run#2952
Conversation
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
Reviews (1): Last reviewed commit: "fix(canvas): always run canvas generatio..." | Re-trigger Greptile |
Freeform canvas generation hard-coded `workspaceMode: "local"`, so every canvas/dashboard build kicked off a local agent run instead of a cloud run. Switch it to `workspaceMode: "cloud"` so generation always runs server-side, regardless of the user's last-used workspace mode or whether the app is open. The repo-less cloud path is already supported by the task creation saga (it provisions a cloud workspace and starts the run without a repo), and the agent still publishes results via the `desktop-file-system-canvas-partial-update` MCP tool. Generated-By: PostHog Code Task-Id: 36b53fe0-c4f6-473b-b514-21e50941cf52
CONTEXT.md generation hard-coded `workspaceMode: "local"`, same as canvas generation, so it kicked off a local agent run instead of a cloud run. Switch it to `workspaceMode: "cloud"` so generation always runs server-side, regardless of the user's last-used workspace mode or whether the app is open. The repo-less cloud path is already supported by the task creation saga. Generated-By: PostHog Code Task-Id: 36b53fe0-c4f6-473b-b514-21e50941cf52
ca2c713 to
fb272cb
Compare
New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.
…eration Canvas and CONTEXT.md generation always run as cloud runs, but cloud runs only reflect merged code — so a local build of these features can't be tested before merging. Add a dev-only (import.meta.env.DEV) workspace-mode picker to both generation screens so the run can be pointed at a local agent during development. Production is unchanged: the picker is hidden and both hooks default to cloud. The hooks now take an optional workspaceMode (default "cloud"); the UIs reuse the existing WorkspaceModeSelect (restricted to local/cloud) and label it with a tooltip noting it's dev-only. Generated-By: PostHog Code Task-Id: 36b53fe0-c4f6-473b-b514-21e50941cf52
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
There was a problem hiding this comment.
Clean, intentional behavioral fix: canvas generation tasks now default to cloud instead of local workspace mode. The dev-only override picker is properly gated behind import.meta.env.DEV, production always uses cloud, and no API contracts, data models, or security boundaries are affected.
Problem
Canvas generation tasks were running as local agent runs instead of cloud runs. They should always run in the cloud — local runs tie up (and depend on) the user's machine and stop if the app is closed.
Why it was happening: not the sticky "last-used workspace mode" as suspected.
useGenerateFreeformCanvashard-codedworkspaceMode: "local", so canvas generation always ran locally regardless of any prior task. The fix makes it explicitly cloud.Changes
packages/ui/src/features/canvas/hooks/useGenerateFreeformCanvas.ts:workspaceMode: "local"→"cloud", and updated the surrounding comments (scratch-dir reasoning no longer applies).The repo-less cloud path is already supported by
TaskCreationSaga— it provisions a cloud workspace and starts the run with no repo (allowNoRepo), and the agent still publishes results via thedesktop-file-system-canvas-partial-updateMCP tool.taskService.createTaskruns the cloud usage preflight, so an over-limit case surfaces as the existing error toast.Note: the sibling
useGenerateContext.ts(channel CONTEXT.md generation) is hard-coded to"local"the same way — left unchanged since this request is scoped to canvas generation. Happy to flip it too if desired.How did you test this?
No automated tests run — dependencies aren't installed in this environment. The change is a string-literal swap between two valid
WorkspaceModevalues already used throughout the saga and other call sites. Please pull down and verify a canvas generation now creates a cloud run.Automatic notifications
Created with PostHog Code